<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组与循环</title>
</head>

<body>

</body>

</html>
<script>
    let arr0 = [0, 1, 2, 3, 4];
    for (let index = 0; index < arr0.length; index++) {
        // const 用来修饰常量
        const element = arr0[index];
        window.console.log(element);
    }
    window.console.log('+++++++++++++++++++++++++++');
    arr0.forEach(element => {
        window.console.log(element);
    });
    window.console.log('+++++++++++++++++++++++++++');
    for (const element in arr0) {
        window.console.log(element);
    }
    window.console.log('+++++++++++++++++++++++++++');
    for (const element of arr0) {
        window.console.log(element);
    }
</script>